﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;

namespace JMT.Data
{
    public interface IJContainer
    {
        void Add(JModel jModel);
        void Remove(JModel jModel);
        JModel Get(Guid id);
        List<JModel> ToList();
        List<T> GetChildren<T>() where T : JModel;
    }

    //public interface IJContainer<T> where T : JModel
    //{
    //    //event JCollectionChangedEventHandler<T> JCollectionChanged;
    //    void Add(T jModel);
    //    void Remove(T jModel);
    //    T Get(Guid id);
    //    List<T> ToList();

    //    void Register(JContainerUpdate<T> update);
    //}

    //public delegate void JContainerUpdate<T>(object sender, JUpdateEventArgs<T> e);

    //public class JUpdateEventArgs<T>
    //{
    //    public NotifyCollectionChangedAction Action { get; set; }
    //    public IList<T> NewItems { get; set; }
    //    public int NewStartingIndex { get; set; }
    //    public IList<T> OldItems { get; set; }
    //    public int OldStartingIndex { get; set; }
    //}
}
